class DivideByZeroException extends RuntimeException {
    public DivideByZeroException() {
        super("Cannot divide by zero.");
    }
}

class Calculator {
    public static int divide(int dividend, int divisor) {
        return switch (divisor) {
            case 0 -> throw new DivideByZeroException();
            default -> dividend / divisor;
        };
    }
}

public class CustomException {
    public static void main(String[] args) {
        int dividend = 10;
        int divisor = 0;

        try {
            int result = Calculator.divide(dividend, divisor);
            System.out.println("Result: " + result);
        } catch (DivideByZeroException e) {
            System.out.println("Error: " + e.getMessage());
        }
    }
}
